import { initvalue } from "../utils";
import { context } from "../context";
import { Pager } from "./style";

function Page(props: any) {
  const { style, children } = props;
  const { fontScale, resume, heightAuto } = context;

  const { fontSize, lineHeight } = resume.customization.spacing;
  const customStyle: any = {};
  const size = ((fontSize || 0) * 0.5 + initvalue.fontSize) * fontScale;
  customStyle.fontSize = `${size}pt`;
  customStyle.lineHeight = `${size + 3 + size / 8 + lineHeight}pt`;
  if (heightAuto) {
    customStyle.height = "auto";
  }
  return <Pager style={{ ...style, ...customStyle }}>{children}</Pager>;
}
export default Page;
